package com.songlanyun.modules.logisticscompany.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.validator.group.AddGroup;
import com.songlanyun.common.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 平台发布的可适用的物流公司表
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-12 11:05:31
 */
@Data
@TableName("yxt_system_logistics_company")
public class SystemLogisticsCompanyEntity extends RootEntity<Integer,SystemLogisticsCompanyEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    private Integer id;
    /**
     * 物流公司名称
     */
    @NotBlank(message = "物流公司名称不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Length(min = 1, max = 30, message = "物流公司名称在1-30个字", groups = {AddGroup.class})
    private String company;
    /**
     * 物流公司编码
     */
    @NotBlank(message = "物流公司编码不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @Length(min = 1, max = 30, message = "物流公司编码在1-30个字", groups = AddGroup.class)
    private String logisticsCode;
    /**
     * 顺序
     */
    @NotNull(message = "顺序不能为空", groups = {AddGroup.class,UpdateGroup.class})
    private Integer orderIndex;

    @Override
    public Integer getIdentity() {
        return id;
    }
}
